import { defaultLayout } from '@/router/constants'
import { AppRouteRecordRaw } from '../../types'

const dashboardRoutes: AppRouteRecordRaw = {
  path: '/visualization',
  name: 'visualization',
  component: defaultLayout,
  redirect: '/visualization/ExpandChart',
  meta: {
    locale: 'menu.visualization',
    requireAuth: true,
    order: 0,
    icon: 'icon-apps',
  },
  children: [
    {
      path: 'ExpandChart',
      name: 'ExpandChart',
      component: () => import('@/views/dashboard/index.vue'),
      meta: {
        locale: 'menu.visualization.ExpandChart',
        requireAuth: true,
        roles: ['*'],
      },
    },
    {
      path: 'ExpandChartDetail/:key',
      name: 'ExpandChartDetail',
      component: () =>
        import('@/views/dashboard/widgets/expandChartDetail.vue'),
      meta: {
        locale: 'menu.visualization.ExpandChart.Detail',
        requireAuth: true,
        hideInMenu: true,
        roles: ['*'],
      },
    },
    {
      path: 'ComponentManagement',
      name: 'ComponentManagement',
      component: () => import('@/views/ComponentManagement/index.vue'),
      meta: {
        locale: 'menu.visualization.ComponentManagement',
        requireAuth: true,
        roles: ['*'],
      },
    },
    {
      path: 'ComponentManagementDetail/:key',
      name: 'ComponentManagementDetail',
      component: () =>
        import(
          '@/views/ComponentManagement/widgets/componentManagementDetail.vue'
        ),
      meta: {
        locale: 'menu.visualization.ComponentManagement.Detail',
        requireAuth: true,
        hideInMenu: true,
        roles: ['*'],
      },
    },
    {
      path: 'DefinitionKanban',
      name: 'DefinitionKanban',
      component: () => import('@/views/definitionKanban/index.vue'),
      meta: {
        locale: 'menu.visualization.DefinitionKanban',
        requireAuth: true,
        roles: ['*'],
      },
    },
  ],
}

export default dashboardRoutes
